From d2e8e6ea85f2f45dddc78da49b235f8446ee6633 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 15 May 2008 14:19:14 +0000 Subject: [PATCH] Move endian detection back to runtime to benefit universal binaries on Mac. --- gpsbabel/util.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gpsbabel/util.c b/gpsbabel/util.c index 8ded3ea2a..41286af81 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -29,11 +29,17 @@ #include #include +// First test Apple's clever macro that's really a runtime test so +// that our universal binaries work right. +#if defined __BIG_ENDIAN__ +#define i_am_little_endian !__BIG_ENDIAN__ +#else #if defined WORDS_BIGENDIAN # define i_am_little_endian 0 #else # define i_am_little_endian 1 #endif +#endif #ifdef DEBUG_MEM #define DEBUG_FILENAME "/tmp/gpsbabel.debug" -- 2.30.2